public class PassageCar extends Car implements IHumanNum{
    private int humanNum;
    public PassageCar(int ID, String name,int IHumanNum) {
        super(ID, name);
        this.humanNum=IHumanNum;
    }

    @Override
    public int getIHumanNum() {
return humanNum;
    }

    @Override
    public void setIHumanNum(int num) {
this.humanNum=num;
    }
    @Override
    void getCapacity(){
        System.out.println(carName+" 载人数： "+humanNum+"人");
    }
    public static void main(String[] args){
        PassageCar[] cars=new PassageCar[2];
        cars[0]= new PassageCar(1,"奥迪 A4",5);
        cars[1]= new PassageCar(2,"五菱宏光",7);
        cars[0].getCapacity();
        cars[1].getCapacity();
        System.out.println("总人数："+(cars[0].humanNum+cars[1].humanNum));
    }

}
